home *** CD-ROM | disk | FTP | other *** search
- Path: ix.netcom.com!netnews
- From: miker3@ix.netcom.com (Mike Rubenstein)
- Newsgroups: comp.lang.c++
- Subject: Re: What is wrong with this code? (BC45)
- Date: Sun, 28 Jan 1996 01:24:23 GMT
- Organization: Netcom
- Message-ID: <310acfd3.93677184@nntp.ix.netcom.com>
- References: <yMOCxg2yqvDD083yn@iaccess.za>
- NNTP-Posting-Host: ix-dc6-02.ix.netcom.com
- X-NETCOM-Date: Sat Jan 27 5:24:16 PM PST 1996
- X-Newsreader: Forte Agent .99c/16.141
-
- vincer@iaccess.za (Vince Risi) wrote:
-
- > Why would I get an illegal initialization from this code?
- >
- > typedef char * pchar;
- > pchar Fred = "This is a default value";
- > pchar Mark = Fred; // <------ ????
- >
- > Is this a BC45 bug?
-
- Are you compiling as a C++ program? In C that code is illegal at file
- scope (it's legal in a function as long as Mark is not static).
- Borland compilers assume C code if the file extension is .C, C++ if
- the extension is .CPP.
-
-
- Michael M Rubenstein
-